\setscript[hanzi]
\setupalign[hanging, hz]

\usemodule[zhfontsext]
\usetypescript[cnfontb]
\setupbodyfont[cnfontb,rm,12pt] % 小四号 = 12pt
\mainlanguage[cn]

\setupinterlinespace[line=3.66ex] %line=3.05ex相当于WORD 中的1.0倍行距, 3.66ex相当于WORD 中的1.2倍行距

\setuppapersize[A4]
\setuplayout[width=fit,height=fit,backspace=10mm,cutspace=10mm,topspace=10mm,margin=10mm,header=10mm,footer=10mm]
\setuppagenumbering[location={header,right},style=\bfb]

\define[1]\exampleLine{
    \blank[10pt]
    \framed[frame=off,align=flushleft,offset=3pt,strut=none,width=\textwidth,height=fit,background=color,backgroundcolor=gray]{{\bfx #1}}
    \blank[5pt]
}
\starttext

\exampleLine{代码示例 - 7:}
\setupframed[width=2cm,height=fit,align=middle]

\ruledhbox
  {A
   \framed[location=normal] {location\\normal} \quad
   \framed[location=keep]   {location\\keep} \quad
   \framed[location=depth]  {location\\depth} \quad
   \framed[location=height] {location\\height} \quad
   \framed[location=hanging]{location\\hanging} \quad
   \framed[location=formula]{location\\formula} \quad
   \framed[location=mathematics]{location\\mathematics} \quad
   B}
\vskip2cm

\ruledhbox
  {A
  \framed[location=top]    {location\\top} \quad
  \framed[location=high]   {location\\high} \quad
  \framed[location=low]    {location\\low} \quad
  \framed[location=bottom] {location\\bottom} \quad
  \framed[location=middle]   {location\\middle} \quad
  \framed[location=line]   {location\\line} \quad
  \framed[location=lohi]   {location\\lohi} \quad
   B}
\vskip2cm


\stoptext